#include("_user_detail_layout.html")
#@user_detail_layout("detail-role")
#define detail()

<style type="text/css">
    .switchery-item {
        padding-bottom: 10px;
    }

    .switchery-item .switchery-small {
        margin-top: -2px;
        margin-right: 10px;
    }
</style>


<!-- /.card-header -->
<!-- form start -->
<form class="" autocomplete="off" id="userForm" action="#(CPATH)/admin/user/doUpdateUserRoles">
    <input name="userId" type="hidden" value="#(user.id)">
    <div class="card-body">

        <h4 class="form-header">用户角色</h4>

        <div class="form-group row">
            <label class="col-sm-2 col-form-label"></label>
            <div class="col-sm-6">
                #for(role : roles)
                <div class="switchery-item">
                    <input type="checkbox" class="switchery" name="roleId" value="#(role.id)"
                           #checkedIf(hasRole(user.id,role.id))>
                    #(role.name ??)
                    #if(role.isSuperAdmin())
                    - 超级管理员
                    #end ( <a href="#(CPATH)/admin/user/role/permissions/#(role.id)">查看权限</a> )
                </div>
                #end
            </div>
        </div>


    </div>

    <div class="card-footer">
        <div class="offset-sm-2 col-sm-10 submit-block">
            <div class="card-submit">
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>

</form>
#end

